package cn.hp.service.impl;

import cn.hp.entity.User;
import cn.hp.mapper.UserMapper;
import cn.hp.service.IUserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class UserServiceImpl implements IUserService {
    @Resource
    private UserMapper userMapper;
    @Override
    public User selectUserById(Integer id) {
        return userMapper.selectUserById(id);
    }
    @Override
    public User dologin(User user) {
        List<User> list = userMapper.dologin(user);
        return list.size() > 0 ? list.get(0) : null;
    }
}

